import React from 'react';
import '../public/static/css/index.css'; // 导入样式文件

const BookList = ({ books, deleteBook }) => {
  return (
    <div className="book-list">
      {books.map((book) => (
        <div key={book._id} className="book-item">
          <span>{book.title}</span>
          <div className="book-actions">
            <button className="action-button">编辑</button>
            <button className="action-button delete" onClick={() => deleteBook(book._id)}>删除</button>
          </div>
        </div>
      ))}
    </div>
  );
};

export default BookList;
